package com.gitee.wsl.data.input.viewmodel.scopes

import com.gitee.wsl.data.input.EventStrategyScope
import com.gitee.wsl.data.input.event.EventHandler
import com.gitee.wsl.data.input.viewmodel.actors.EventActor


internal class EventStrategyScopeImpl<Inputs : Any, Events : Any, State : Any>(

    private val eventActor: EventActor<Inputs, Events, State>,

    private val handler: EventHandler<Inputs, Events, State>,
) : EventStrategyScope<Inputs, Events, State> {

    override suspend fun dispatchEvent(event: Events) {
        eventActor.safelyHandleEvent(event, handler)
    }
}
